import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
          path: '/',
          name: 'LoginView',
          component: () => import('../views/LoginView.vue'),
    },
    {
          path: '/UserMenuView',
          name: 'UserMenuView',
          component: () => import('../views/UserMenuView.vue'),
          children:[
         {
          path: '/UserListView',
          name: 'UserListView',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/User/UserListView.vue'),
        },
         {
          path: '/RoleList',
          name: 'RoleList',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/User/RoleListView.vue'),
        },
        {
          path: '/MenuDevice',
          name: 'MenuDevice',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/Menu/MenuDeviceView.vue'),
        },
         {
          path: '/RoleMenu',
          name: 'RoleMenu',
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import('../views/Menu/RoleMenuView.vue'),
        },
        {
          path: '/ExcusedList',
          name: 'ExcusedList',
          component: () => import('../views/Excused/ExcusedListView.vue'),
        },
        {
          path: '/ExcusedForm',
          name: 'ExcusedForm',
          component: () => import('../views/Excused/ExcusedFormView.vue'),
        },
         {
          path: '/Basic_traceabilityView',
          name: 'Basic_traceabilityView',
          component: () => import('../views/Traceability/Basic_traceabilityView.vue'),
        },
         {
          path: '/TraceabilityDetailView',
          name: 'TraceabilityDetailView',
          component: () => import('../views/Traceability/TraceabilityDetailView.vue'),
        },

        ///库存盘点
         {//库存任务列表
          path: '/InventoryTask',
          name: 'InventoryTask',
          component: () => import('../views/Inventory/InventoryTaskView.vue'),
        },

        {//新增库存单
          path: '/AddInventory',
          name: 'AddInventory',
          component: () => import('../views/Inventory/AddInventoryView.vue'),
        },
        {//盘点详情
          path: '/InventoryDetail',
          name: 'InventoryDetail',
          component: () => import('../views/Inventory/InventoryDetailView.vue'),
        },

        {//实时统计大屏
          path: '/RealtimeStatistics',
          name: 'RealtimeStatistics',
          component: () => import('../views/Inventory/RealtimeStatisticsDashboard.vue'),
        },
        
      ]
    },
    {
      path: '/MenuView',
      name: 'MenuView',
      component: () => import('../views/MenuView.vue'),
      children:[
         {
          path: '/UserList',
          name: 'UserList',
          component: () => import('../views/User/UserListView.vue'),
        },
         {
          path: '/RoleListView',
          name: 'RoleListView',
          component: () => import('../views/User/RoleListView.vue'),
        },
        {
          path: '/MenuDeviceView',
          name: 'MenuDeviceView',
          component: () => import('../views/Menu/MenuDeviceView.vue'),
        },
         {
          path: '/RoleMenuView',
          name: 'RoleMenuView',
          component: () => import('../views/Menu/RoleMenuView.vue'),
        },
         {
          path: '/ExcusedListView',
          name: 'ExcusedListView',
          component: () => import('../views/Excused/ExcusedListView.vue'),
        },
         {
          path: '/ExcusedFormView',
          name: 'ExcusedFormView',
          component: () => import('../views/Excused/ExcusedFormView.vue'),
        },
         {
          path: '/DialogView',
          name: 'DialogView',
          component: () => import('../views/DialogView.vue'),
        },
        

      ]
    },
  ],
})

export default router
